package eduware.gui;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;

/**
 * 
 * @author Marie Jurischka
 *
 */

public class AboutDialog extends JDialog implements ActionListener{
	
	/**
	 * Generated Version ID
	 */
	private static final long serialVersionUID = -7205078084982519444L;
	
	JButton aboutButton;

	public AboutDialog(){
		
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		
		this.getContentPane().setLayout(new GridLayout(1, 1, 3, 3));

		this.setResizable(false);

		this.setSize(791, 240);

		this.setLocation(screenSize.width / 2 - this.getWidth() / 2, screenSize.height / 2 - this.getHeight() / 2);

		this.setUndecorated(true);

		ImageIcon aboutButtonIcon = new ImageIcon("img/AboutDochi.png");

		aboutButton = new JButton(aboutButtonIcon);

		aboutButton.addActionListener(this);

		this.getContentPane().add(aboutButton);

		this.setAlwaysOnTop(true);
		this.pack();
		this.setVisible(true);
		
	}
	
	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == this.aboutButton) {
			this.setVisible(false);
		}
		
	}

}

